﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Data;

using PolePositionMobileUtilityGeneral;

namespace PolePositionMobileUtilityEntity
{
    public class EMap : EBaseLookup
    {
        public EMap()
        :base()
        {
            m_TableCollumnId = "MapId";
            m_TableName = "tb_Maps";
        }

        public EMap(int id, string name)
            : this()
        {
            Id = id;
            Name = name;
        }



        public EMap[] GetAll()
        {
            DataTable _dt = SelectAll();
            EMap[] arr = new EMap[_dt.Rows.Count];
            for (int i = 0; i < _dt.Rows.Count; i++)
            {
                arr[i] = new EMap(ConvertMobileHelper.ToInt32(_dt.Rows[i][m_TableCollumnId]), ConvertMobileHelper.Tostring(_dt.Rows[i][m_TableCollumnName]));
            }
            return arr;
        }
    }
}
